import Loading from './index.vue';
import { createApp } from 'vue';


const container = document.createElement('div');


Loading.service = (props) => {
    const loading = createApp(Loading, {
        ...props
    });
    
    open();

    function open(){
        document.body.appendChild(container);
        loading.mount(container);
    }

    return {
        close(){
            loading.unmount();
            container.remove();
        }
    };
}

export default Loading;